<template>
  <div
      class="title-box"
      @click="toSub"
  >
    <span>{{ props.title }}</span>
  </div>
</template>

<script setup>
import '@/assets/css/base.less'
import {onMounted} from "vue";
import {useRouter} from "vue-router";
const props = defineProps(['title','addr'])
const router = useRouter()
onMounted(()=>{
  //.log(props.title)
})
const toSub = ()=>{
  if(props.addr){
    router.push(props.addr)
  }
}

</script>

<style scoped lang="less">
.title-box{
  cursor: pointer !important;
  width: 10vw;
  height: 4vh;
  line-height: 4vh;
  background-color: #2C58A6;
  border-radius: 18px;
  position: absolute;
  top: -1.5vh;
  left: 50%;
  margin: -1% -20%;
  color: #fff;
  font-size: 2vh;
  box-sizing: border-box;
  z-index: 1000;
  text-align: center;
  box-shadow: none;
  letter-spacing: 2px;
  img{
    position: absolute;
    top: 8px;
    left: 20px;
  }
  &:hover{
    background-color: #00BFFF;
  }
}
</style>